// 标题栏状态
const state = {
  header: {
    opened: true,
    canBack: false,
    canClose: false,
    title: '1561'
  }
}
// 修改状态
const mutations = {
  TOGGLE_HEADER: (state, mate) => {
    state.header.opened = !!mate.title
    state.header.title = mate.title
    state.header.canBack = mate.canBack !== false
  }
}

const actions = {
  toggleHeader({ commit }, mate) {
    commit('TOGGLE_HEADER', mate)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
